<?php
class Zend_View_Helper_showTableProduct {

    public function showTableProduct($view) {
        
        $arrProduct = $view->arrProduct; 
        $strHtml = '';
        $strHtml .= '<table class="hovertable">';
        $strHtml .= '<tr>';
        $strHtml .= '<th>Tên sản phẩm</th>';
        $strHtml .= '<th>Dòng sản phẩm</th>';
        $strHtml .= '<th>Số lượng</th>';
        $strHtml .= '<th>Giá tiền</th>';
        $strHtml .= '<th>Trọng lượng</th>';
        $strHtml .= '<th>Hiển thị</th>';
        $strHtml .= '<th>Thao tác</th>';
        $strHtml .= '</tr>';
        if(isset($arrProduct))
        foreach ($arrProduct as $Product) {
            
            $strHtml .= '<tr id="tablerow">';
            $strHtml .= '<td> <a href="'.$view->baseUrl().'/product/detail/id/'.$Product->product_id.'">'. $Product->product_name. '</a></td>';
            $strHtml .= '<td>'. $Product->product_model.'</td>';
            $strHtml .= '<td>'. $Product->product_quantity.'</td>';
            $strHtml .= '<td>'. $Product->product_price.'</td>';
            $strHtml .= '<td>'. $Product->product_weight.'</td>';
            $strHtml .= '<td>'. $Product->product_status.'</td>';
            $strHtml .= '<td>
                             <a class="icon-3" href="'.$view->baseUrl().'/product/addinfo/id/'.$Product->product_id.'"/>
                             <a class="icon-1" href="'.$view->baseUrl().'/product/edit/id/'.$Product->product_id.'"/>
                             <a class="icon-2" href="'.$view->baseUrl().'/product/delete/id/'.$Product->product_id.'"/>
                             </td>';
            $strHtml .= '</tr>';
        }
        
        $strHtml .= '</table>';
        return $strHtml ;
    }
}